/*  tBookShelf: TextPlugin
    (C) 2007  TvN (Volodymyr Tarasenko), e-mail: tvntsr@yahoo.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef TEXT_STYLE_PLUGIN_HPP
#define TEXT_STYLE_PLUGIN_HPP

#include <string>

enum Align
{
    None,
    Left,
    Right,
    Center,
    Justify
};



class TextStyle
{
    friend class ConfigParser;
private:
//    TextStyle(const TextStyle&);
//    TextStyle& operator=(const TextStyle&);

protected:

public:
    TextStyle()
        : name(), 
          font(), 
          font_file(), 
          style(), 
          size(0),
          hyphenation(false), 
          before(0), after(0), firstline(0),
          spacing(0), interlinespace(0),
          tabs(0), scipspaces(0),
          use_kerning(true),
          align(None),
          fuse(false)
    {    }

    const std::string& Name() const
    {
        return name;
    }

    const std::string& Font() const
    {
        return   font;
    }
    const std::string& FontFile() const
    {
        return   font_file;
    }
    const std::string& Style() const
    {
        return style;
    }
    
    const unsigned int& Size() const
    {
        return size;
    }
    
    const bool& Hyphenation() const
    {
        return hyphenation;
    }

    const unsigned int& Before() const
    {
        return before;
    }

    const unsigned int& After() const
    {
        return after;
    }

    const unsigned int& FirstLine() const
    {
        return firstline;
    }
    const unsigned int& Spacing() const
    {
        return spacing;
    }
    const unsigned int InterLineSpace() const
    {
        return interlinespace;
    }
    const bool UseKerning()const
    {
        return use_kerning;
    }
    const unsigned int Tabs() const
    {
        return tabs;
    }
    const unsigned int ScipSpaces() const
    {
        return scipspaces;
    }
    const Align TextAlign() const
    {
        return align;
    }
    const bool Fuse() const
    {
        return fuse;
    }

private:
    std::string  name;
    std::string  font;
    std::string  font_file;
    std::string  style;
    unsigned int size;
    
    bool         hyphenation;
    unsigned int before;
    unsigned int after;
    unsigned int firstline;
    unsigned int spacing;
    unsigned int interlinespace;
    unsigned int tabs;
    unsigned int scipspaces;
    bool         use_kerning;
    Align        align;
    bool         fuse;

/* In lua it declared as:
   name = "Paragraph",
   font = "arial",
   style = nil,
   size= 14,
   hyphenation = "yes",
   before = 5,
   after = 5,
   firstline = 0,
   spacing = 2,
   tabs = 8,
   use_kerning = "yes"
   align = "center"
*/
};

#endif //TEXT_STYLE_PLUGIN_HPP
